import Cookies from "js-cookie";

const TokenKey = "xkc-Token";

const UserKey = "user-Token";

export function getToken() {
  return Cookies.get(TokenKey);
}

export function setToken(token) {
  return Cookies.set(TokenKey, token);
}

export function removeToken() {
  return Cookies.remove(TokenKey);
}


export function getUser() {
  let value =Cookies.get(UserKey);
  if(value == null) return null
  return JSON.parse(value);
}

export function setUser(user) {
  let value = JSON.stringify(user)
  return Cookies.set(UserKey, value);
}

export function removeUser() {
  return Cookies.remove(UserKey);
}


